<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
 <%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML Transitional//EN">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript" language="javascript" src="<%=path %>/resources/js/jquery-1.4.3.js"></script>
<script type="text/javascript">
function executeSql(){
	var sqlValue=$("#sql").val();
	//1检查数据是否合格
	if(sql==""){
		alert("提交的sql不能为空!");
		return ;
	}
	if(confirm("确定提交sql语句到后台吗?")){
		var url="<%=path %>/executCMD";
		$.ajax({
			type : "POST",
			url :url,
			data :{'cmd':sqlValue},
			dataType : "text",
			error : function(json) {
				alert("执行程序异常:"+json);
			},
			success : function(data) {
				$("#cmdResult").val(data);
			}
		});
	}	
}

</script>
<STYLE type=text/css>
BODY {
	BACKGROUND: #e3f0ed
}
.zx{
	float:left;
	height: 20px;
	width: 20px;
	
}
.zx a:hover{
	float:left;	
	height: 20px;
	width: 20px;
	background-color: #a6ceda;
}
.z_table{
	border: 1px solid #e0dcdc;
	border-bottom:none;
	border-right:none;
	background-color: #fafafa;
}
.z_table td{border-bottom: 1px solid #e0dcdc; border-right: 1px solid #e0dcdc;}
.z_title {
	BACKGROUND-COLOR: #eae7e7; HEIGHT: 28px
}
.z_tr {
	HEIGHT: 25px
}
.z_button{
	line-height: 24px;
	background-image: url(<%=path %>/resources/images/button_b.gif);
	background-repeat: no-repeat;
	text-align: center;
	float: left;
	height: 24px;
	width: 65px;
	font-family: "微软雅黑";
	font-size: 13px;
}
a img,img{border:0 none; }
</STYLE>
</HEAD>
<BODY>

<DIV class="ui-layout-north" >
	<div style="padding-left:20px;margin-top: 5px;">
		<a href="javascript:;" onclick='executeSql();' style="font-size: medium" id="exe_a">
		<img src="<%=path %>/resources/images/execute.gif" width="65" height="24" style=" margin-top:2px; margin-left:2px;" id="exe_img">
		</a>
		<br/>
	</div>
</DIV>  
<DIV class="ui-layout-center" >
	<div style="padding-left:20px;margin-top: 5px;">
	<textarea rows="" cols="" style="width: 90%;height:50px;font-size: medium" id="sql" onkeyup="javascript:if(event.keyCode==13){executeSql();}"></textarea>
	</div>
</DIV>
<DIV class="ui-layout-west" >
	<div style="padding-left:20px;margin-top: 5px;">
		<div id="operation_select" style="font-size: medium;">
			<div>
			执行结果：
			</div>
			<div style="width:90%; float:left; height:330px">
				<textarea rows="" cols="" style="width: 100%;height:320px;font-size: medium" id="cmdResult" readonly="ture">
				</textarea>
			</div>	
		</div>
	</div>
</DIV>
</BODY>
</HTML>